using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace DungeonOfDespair
{
    public class Effects
        : List<Effect>
    {
        private Room m_room;

        public Effects(Room room)            
        {
            m_room = room;
        }

        public void Reset()
        {
            this.Clear();
        }

        public void Update()
        {
            for (int iIndex = this.Count - 1; iIndex >= 0; iIndex--)
            {
                Effect effect = this[iIndex];
                effect.Update();
                if (!effect.Active)
                    this.RemoveAt(iIndex);
            }
        }

        public void Draw(Graphics graphics)
        {
            foreach (Effect effect in this)
                effect.Draw(graphics);
        }

        public Room Room
        {
            get { return m_room; }
        }
    }
}
